package com.weigee.ktv.v.fragment;

import android.content.Context;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.l.d.app.library.app.FragActivity;
import com.weigee.ktv.R;
import com.weigee.ktv.v.activity.ActivityUtil;
import com.weigee.ktv.v.activity.StandardActivity;

import butterknife.OnClick;

/**
 * Created by 林德 on 2017/4/10 9:47.
 * <p/>
 * 个人中心
 */
public final class UserProfileFragment extends BaseFragment {
    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        return inflater.inflate(R.layout.main_frag_left_menu, container, false);
    }

    @Override
    protected void initView(View view, @Nullable Bundle savedInstanceState) {
    }

    /**
     * 钱包
     */
    @OnClick(R.id.tv_wallet)
    protected void onWalletClick(View view) {
        FragActivity.start(StandardActivity.class, view.getContext(), ActivityUtil.WALLET_DATA);
    }

    /**
     * 消息
     */
    @OnClick(R.id.tv_news)
    protected void onNewsClick(View view) {
        FragActivity.start(StandardActivity.class, view.getContext(), ActivityUtil.SYSTEM_INFORMS, null);
    }

    /**
     * 客服
     */
    @OnClick(R.id.tv_gm)
    protected void onGmClick(View view) {
        goActivity(ActivityUtil.USER_PROFILE_FEEDBACK, null);
    }

    /**
     * 其他
     */
    @OnClick(R.id.tv_others)
    protected void onOthersClick(View view) {
        goActivity(ActivityUtil.USER_PROFILE_OTHERS_MSG, null);
    }

    private void goActivity(String fragmentTag, Bundle bundle) {
        Context context = getActivity();
        if (context == null) context = getContext();
        FragActivity.start(StandardActivity.class, context, fragmentTag, bundle);
    }
}
